interface Res<F> {
  code: number;
  data: F
  message: string;
}
export type httpServer<T, F = any> = (body: T) => Promise<Res<F>>;

// 登录
export interface LoginProps {
  password: string;
  username: string;
  captcha: string;
  actionType: "login" | "register";
}

export interface FindUserByuserNameProps {
  username: string;
}

export interface CreateUserProps {
  password: string;
  username: string;
  captcha: string;
  email: string;
}

export interface FindUserByIdProps {
  id: string | number;
}




// 发布
export interface PublishItem {
  id?: string | number
  user_id: string | number;
  role: "driver" | "passenger";
  nickname: string;
  time: string;
  startLocation: string;
  endLocation: string;
  phone: string | number;
  wechat: string;
  email: string;
  price: string;
  peopleNumber: string;
  carNumber: string;
  seat: string;
  carModel: string;
  via: string;
  remarks: string;
  created_at: string;
  updated_at: string;
  startProvince: { code: string; name: string };
  startCity: { code: string; name: string };
  startCounty: { code: string; name: string };
  endProvince: { code: string; name: string };
  endCity: { code: string; name: string };
  endCounty: { code: string; name: string };
  rocket: string;
  collect: string;
  report: string;
}


export interface PublishPageProps {
  list: Array<PublishItem>
  total: number
}

export interface publishPageParams {
  pageSize: number
  pageNumber: number
  search: string
  role: 'driver' | 'passenger',
  des: 'startLocation' | 'endLocation' | 'all' ,
  map:{
    pro: {
      code: number | string
      name: string
    }
    city?:{
      code: number | string
      name: string
    },
    county?:{
      code: number | string
      name: string
    }
  }
}



export interface CreateParamsProps{}



export interface UserProps{
  id: string | number
  username: string
  nickname: string
  email: string
  phone: string
  carNumber: string
  password?: string
  image: string
  gender: string
  signature: string
  rocketCount: string
  createdAt: string
  upatedAt: string
}

export interface PutUserProps{
  id: number | string
  data: Omit<UserProps, 'id'>
}



export interface CollectItemProps{
  id: number
  userId: number,
  publish_id: string,
  startLocation: string
  endLocation: string
}

export interface FindColloectByUserIdProps{
  userId: string
}


export interface UserOperateBehaviorProps{
  publish_id: string
  data: {
    type: 'rocket' | 'collect' | 'report';
    userId: string;
  }
}


export interface BeforeHaveThisBehaviorProps{
  publish_id: string
  userId: string
  type: 'rocket' | 'collect' | 'report';
  // userId: string;
}


export interface CreateCollectItemProps{
  userId: string
  publish_id: string
}


export interface CreateReportItemProps{
  userId: string
  reportType: string
  reportContent: string
  publish_id: string
}



export interface CreateRocketItemProps{
  userId: string
  publish_id: string
}




export interface QueryReportTypeListProps{
  type: 'role' | 'gender' | 'reportType'
}